Conversation
|
This is a basic implemention. I will try to add test and glue all the pieces together once I know I'm on the right way ;) |
|
Don't you think an auto-retry might just increase the problem of too many requests? |
|
The patch specifically look for 429 errors and sleep exponentially before retrying, so no I don't think so ;) |
|
Thanks for the correction, it's not ready yet thow. I will fetch your changes and add the glue with the root object Odoo |
|
Added glue. |
|
I would also that setting autoretry to True by default can be good. |
| # Default autoretry for .odoo.com (saas) hosts | ||
| if 'autoretry' in kwargs: | ||
| self._autoretry = kwargs['autoretry'] | ||
| elif host.endswith('.odoo.com'): | ||
| self._autoretry = True | ||
| else: | ||
| self._autoretry = False |
There was a problem hiding this comment.
I don't particularly like this kind of magic. But in case it were, then you can default the autoretry arg to None, enabling this magic, insteado of relying in the existence of the kwarg. It would be the same result, but simplify the methods signature.
Making things obvious and predictable is good IMHO.
In any case, this (and the rest of the feature) deserves an entry in the docs.
When 429 error, auto retry the requests.
5d19816 to
8015046
Compare
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
With the latest odoo I start to have a lot of HTTPError 429 Too Many Request.
What do you think of this implementation of an auto-retry ?